package practice.game.plane.conn.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

import practice.game.plane.conn.ConnConsts;

public class ServerStarter {
	public static ServerSocket ss;

	public static Socket client;

	public static Socket getSocketClient() throws IOException {
		if (client == null) {
			ss = new ServerSocket(ConnConsts.PORT);
			client = ss.accept();
		}
		return client;
	}

	public static void close() {
		try {
			ss.close();
			ss = null;
			client = null;
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
